

#ifndef __IR_CONTROL_H_
#define __IR_CONTROL_H_


#define IR_RECV_BUF_LENGTH    20
#define IR_RX_LENGTH 		7


//配置内联结构体 方便标记获取错误 或者初始化复位为FF ，读写之前配置为FF
typedef struct
{
	unsigned char AirState;//空调开关状态
	unsigned char AirTemp; //空调温度
	unsigned char AirModel;//空调模式
	unsigned char AirFan;//风扇状态-风速
	unsigned char AirLight;//风扇灯光状态
	unsigned char GetAirParaCount;
	unsigned short fromat;//红外编码
}Str_IR_Para;

extern Str_IR_Para str_LocalIR_Para;

extern unsigned char Uart_IR_Recv_Buf[IR_RECV_BUF_LENGTH];
extern unsigned char uc_IR_Rx_Finish;

extern unsigned char uc_LearnChannel;
extern unsigned char uc_IRLearnFlag;

extern void RecvIRUartDat(void);

void GetCurrentAirCode(void);
void GetAirFormat(void);
void SetAirFormat(unsigned short format);
void SetAirTemperature(unsigned char Temperature);
void AutoSetAirFormat(void);
void StartIRLearn(unsigned char LearnChannel);
void StopIRLearn(unsigned char LearnChannel);

void GetAirPowerState(void);
void GetAirTempState(void);
void GetAirModeState(void);
void GetAirFanState(void);
void GetAirLightState(void);


void openAirCondit(void);
void CloseAirCondit(void);
void ContrlUseLearnChannel(unsigned char CtrlChannel);

void ReadIRFormat(void);
void ReadAirStatus(void);
void ReadIRTemp(void);
void ReadAirMode(void);

void Get_Air_ConditonData(void);
void SetAirTemperatureUp(void);

void ReadTRTest(void);
unsigned char ReadIRLearnStatus(void);

#endif
